import { request } from '@/utils/request.js'

/**
 * 托盘 API JS
 */

export default {
  /**
   * 托盘组列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'sea/waybillTray/index',
      method: 'get',
      params
    })
  },
    /**
   * 托盘列表
   * @returns
   */
    waybillTrayList (params = {}) {
      return request({
        url: 'sea/waybillTrayList/index',
        method: 'get',
        params
      })
    },
       /**
   * 读取托盘组详情
   * @returns
   */
   read (id) {
    return request({
      url: 'sea/waybillTray/read/' + id,
      method: 'get',
    })
  },
  //托盘接收
  recived (data = {}) {
    return request({
      url: 'sea/waybillTray/recived',
      method: 'put',
      data
    })
  },

  /**
   * 添加
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'sea/waybillTray/save',
      method: 'post',
      data
    })
  },

  /**
   * 更新数据
   * @returns
   */
  update (data = {}) {
    return request({
      url: 'sea/waybillTray/update/' + data.id,
      method: 'put',
      data
    })
  },
  /**
   * 分配任务
   * @returns
   */
  taskTap (data = {}) {
    return request({
      url: 'sea/waybillTray/task',
      method: 'post',
      data
    })
  },
 /**
   * 打印标签
   * @returns
   */
 printTap (data = {}) {
  return request({
    url: 'sea/waybillTray/print',
    method: 'post',
    responseType: 'blob',
    data
  })
},
 /**
   * 托盘组绑定出仓单
   * @returns
   */
 waybillTrayTask (data = {}) {
  return request({
    url: 'sea/waybillTray/task',
    method: 'post',
    data
  })
},
 /**
   * 托盘运单绑定关系
   * @returns
   */
 trayShipment (data = {}) {
  return request({
    url: 'sea/waybillTrayList/trayShipment',
    method: 'post',
    data
  })
},
 /**
   * 选择运单列表
   * @returns
   */
 getShipment (params = {}) {
  return request({
    url: 'sea/waybillList/index',
    method: 'get',
    params
  })
},
}